//
//  OtherViewController.m
//  CategoryKit
//
//  Created by xinpenghui on 16/12/14.
//  Copyright © 2016年 xinpenghui. All rights reserved.
//

#import "OtherViewController.h"
#import "AppUIDefine.h"

//#import "FFAuthorizationTools.h"
//#import "FFDateTools.h"

@interface OtherViewController ()<UIImagePickerControllerDelegate>

@end

@implementation OtherViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.title = @"Other";
    self.view.backgroundColor = [UIColor whiteColor];
    
    [self testCase]; // 正常测试
    
    [self takePhoto]; // 打开相册 相机测试
    
    [self testDateTime];
}

- (void)testDateTime {
    
//    NSLog(@"time stemp = %@",[NSDate timeStamp]); //1481699381263   1481699424961
    double value = 1481645966;
    double value2 = 1481647966;
    
//    2016-12-14 00:19:26-2016-12-14 00:52:46
    
    NSNumber *number1 = [NSNumber numberWithDouble:value];
    NSNumber *number2 = [NSNumber numberWithDouble:value2];

//    NSString *string = [FFDateTools getStringFromStartTime:number1 endTime:number2];
//    NSString *stringFormat = [FFDateTools getStringFromStartTime:number1 endTime:number2 withSeparateString:@"-" withFormat:@"yyyy-MM-dd HH:mm:ss"];
    
//    NSLog(@"value intValue = %d =%d",number1.intValue,number2.intValue);
    
//    NSString *string = [FFDateTools getStringFromStartTime:[NSNumber numberWithInt:1481697810] endTime:[NSNumber numberWithInt:1481697882]];
//    NSString *stringFormat = [FFDateTools getStringFromStartTime:[NSNumber numberWithInt:1481697810] endTime:[NSNumber numberWithInt:1481697882] withSeparateString:@"-" withFormat:@"yyyy-MM-dd HH:mm:ss"];
    
    
//    NSLog(@"testDateTime string = %@ format string =%@",string,stringFormat);
}

- (void)testCase {
//    [FFAuthorizationTools startCameraWithAuthSuccessBlock:^{
//        NSLog(@"成功");
//    } failureBlock:^{
//        NSLog(@"失败");
//    }];
}

- (void)takePhoto
{
//    UIImagePickerControllerSourceType sourceType = UIImagePickerControllerSourceTypeCamera;
    UIImagePickerControllerSourceType sourceType = UIImagePickerControllerSourceTypePhotoLibrary;

//    if ([UIImagePickerController isSourceTypeAvailable: UIImagePickerControllerSourceTypeCamera])
//    {
//        UIImagePickerController *picker = [[UIImagePickerController alloc] init];
//        picker.delegate = self;
//        picker.sourceType = sourceType;
//        weakObj(self)
//        [FFAuthorizationTools startCameraWithAuthSuccessBlock:^{
//            strongObj(self)
//            [self presentViewController:picker animated:YES completion:nil];
//        } failureBlock:^{
//            [[[UIAlertView alloc] initWithTitle:@"相机无法使用" message:@"请在iPhone的“设置->隐私->相机”选项中，允许飞凡访问您的手机相机" delegate:self cancelButtonTitle:@"确定" otherButtonTitles: nil] show];
//        }];
//    }
//    else
//    {
//    }
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
